﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using 控件调整.Common;

namespace 控件调整.ViewModels
{
    public class UserModifyViewModel : BaseViewModel
    {
        public Func<List<FileInfo>, Response> UploadFileCmd { get; set; }
        public Action<Response> UploadSuccessCmd { get; set; }
        public Action<Response> UploadFailCmd { get; set; }
        public UserModifyViewModel()
        {
            UploadFileCmd = UploadFile;
            UploadSuccessCmd = UploadSuccess;
            UploadFailCmd = UploadFail;
        }

        public Response UploadFile(List<FileInfo> fileList)
        {
            return new Response() 
            { 
                StatusCode = 200,
                Message = "文件上传成功"
            };
        }

        public void UploadSuccess(Response resp)
        {
            MessageBox.Show(resp.Message);
        }

        public void UploadFail(Response resp)
        {
            MessageBox.Show(resp.Message);
        }
    }
}
